home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 / Aminet - June 1993 [Walnut Creek].iso / ab20 / languags / cpp / gcgp1409.lha / hunk2gcc / README < prev   
Encoding:
Text File  |  1992-01-27  |  3.7 KB  |  83 lines

  1. This is just a minor bug fix, that caused hunk2gcc to generate wrong code
  2. with absolute symbols (like those _LVOs in amiga.lib)
  3. --------------------------------------------------------------------------
  4.  
  5. Although I always said, I'll never provide BLINK support for gnu-ld, I sort
  6. of did now. This converter (hunk2gcc) allows you to
  7.   o  convert object files in hunk form into a.out object files
  8.   o  convert ALINK style (ie. concatenated) libraries into a collection of 
  9.      a.out files, that you later can move into an archive with `ar'
  10.  
  11. Since I don't yet have a 3rd edition of the AmigaDOS manual (sigh, I wonder
  12. whether our dear book stores manage to get a copy still this year;-() I
  13. didn't have documentation for the new hunk types dealing with base relative
  14. addressing.  I tried to implement them based on how the non base relative
  15. types work, don't know if I did it right.  It's not that bad if it's done
  16. wrong for the moment, since ld doesn't yet know how to deal with base
  17. relative symbols anyway;-)
  18.  
  19. I wrote this converter mainly because I didn't like the idea of
  20. disassembling and reassembling amiga.lib, and I really wanted to use those
  21. commodities support functions;-) I tested the converter on amiga.lib, and
  22. (besides generating huge disk traffic...) it seemed to work, at least those
  23. programs I used the library with seem to work as they should.
  24.  
  25. However, I really don't have the necessary amount of object files and
  26. libraries in this format to decide whether I missed one or two cases, so 
  27. please tell me about bugs you find.
  28.  
  29. For the new HUNK_INDEX and HUNK_LIB types:  I asked a friend (that
  30. amazingly got his copy of the 3rd edition somewhere from outer space I
  31. guess;-)) just how I should skip them cleanly..  It turned out that those
  32. hunks are not just additions to the existing hunks, they really replace the
  33. old style hunks, and I just didn't see a reason why I should support this
  34. ugly (IMHO) construction, overall librarians that generate such libraries
  35. should be able to generate oldstyle ALINK libraries as well.
  36.  
  37.  
  38. How to use this tool
  39. --------------------
  40. Best thing is, make a new directory where you want your converted object
  41. files to go, cd into it, and enter
  42.  
  43.   hunk2gcc commo:amiga.lib [..further libs if you like..]
  44.  
  45. This generats an a.out object file for every program unit present in the
  46. hunk file (in this case, from amiga.lib).
  47.  
  48. I first wanted to use the name of the program unit for the name of the
  49. object file, but soon saw that those names are rarely to never useful, they
  50. often aren't even set, and sometimes (hi SAS..) even contain `.c' names,
  51. not right what you usually want as object file;-) Names that are used now
  52. start with `obj.', followed by a serial number, followed by a pattern
  53. built from the task address, such that the generated name is unique and
  54. doesn't overwrite any existing file. 
  55.  
  56. As the final step convert all those files into an a.out style library by
  57. issuing:
  58.  
  59.   ar rs libamiga.a obj.*
  60.  
  61. This also builds a symbol table in the archive, and makes accesses to the
  62. library much faster (same effect as running ranlib on the library
  63. afterwards).
  64.  
  65. If you just want to convert a single object file, you might give it a
  66. nicer name after the conversion ;-)
  67.  
  68.  
  69. So...  all you SAS users, switching to gcc was never easier!  You can still
  70. use your libraries, just take the large-model/non-regpar libraries, convert
  71. them with oml into oldstyle libraries or just extract all files and run
  72. hunk2gcc over them with `hunk2gcc *'.  You can then start to use the new
  73. driver that calls ld instead of ln (or blink, if you used the BuRP driver),
  74. and got your proper gcc environment.
  75.  
  76.  
  77. HAVE FUN!
  78.  
  79. Markus Wild
  80.  
  81. PS: Please read the header of hunk2gcc.c for copyright/disclaimer.
  82.     You can reach me at `wild@nessie.cs.id.ethz.ch'.
  83.